class Solution(object):
    def minOperations(self, nums):
        def find(num):
            ansadd = 0
            ansmul = 0
            while num > 0:
                if num % 2:
                    ansadd += 1
                    num -= 1
                else:
                    ansmul += 1
                    num //= 2
            return ansadd, ansmul

        ans = 0
        max_mul = 0
        for num in nums:
            a, m = find(num)
            ans += a
            max_mul = max(max_mul, m)
        return ans + max_mul
